package com.learn.eduadboot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.learn.eduadboot.entity.PromotionAd;
import com.learn.eduadboot.mapper.PromotionAdMapper;
import com.learn.eduadboot.service.PromotionAdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 广告表 服务实现类
 * </p>
 *
 * @author m
 * @since 2022-04-22
 */
@Service
public class PromotionAdServiceImpl extends ServiceImpl<PromotionAdMapper, PromotionAd> implements PromotionAdService {
        @Autowired
        private PromotionAdMapper promotionAdMapper;
    @Override
    public List<PromotionAd> getAdsBySpaceId(Integer sid) {
        QueryWrapper<PromotionAd> qw = new QueryWrapper<>();
        qw.eq("space_id", sid); // where comment_id = #{cid}
        return promotionAdMapper.selectList(qw);
    }
}
